﻿//-----------------------------------------------------------------------
// <copyright>
// This file is subject to the terms and conditions of the Microsoft Public License (MS-PL).
// See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL for more details.
// </copyright>
//----------------------------------------------------------------------- 
using Fulcrum.WeakEventManager;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Fulcrum.UnitTests.WeakEventManager
{
    [DeploymentItem("WeakEventManagerConfig.xml")]
    [TestClass]
    public class WeakEventManagerGeneratorXmlConfigurationReadTests
    {
        WeakEventManagerGeneratorXmlConfiguration config;

        public WeakEventManagerGeneratorXmlConfigurationReadTests()
        {
            // nothing
        }

        //Use TestInitialize to run code before running each test 
        [TestInitialize()]
        public void MyTestInitialize()
        {
            this.config = new WeakEventManagerGeneratorXmlConfiguration("WeakEventManagerConfig.xml");
        }

        [TestMethod]
        public void ValidCompanyValue()
        {
            Assert.AreEqual("My Company", this.config.Company);
        }

        [TestMethod]
        public void ValidNamespaceValue()
        {
            Assert.AreEqual("MyNamespace", this.config.Namespace);
        }

        [TestMethod]
        public void ValidCopyrightValue()
        {
            Assert.AreEqual("Copyright (c) My Company.  All rights reserved.", this.config.Copyright);
        }

        [TestMethod]
        public void CorrectNumberofWeakManagers()
        {
            Assert.AreEqual(2, this.config.WeakEventManagers.Count);
        }
    }
}
